﻿using Microsoft.Extensions.DependencyInjection;
using Modules.FaceScan.Entitys;
using Modules.FaceScan.Repositories;
using PmSoft;

namespace Modules.FaceScan;

/// <summary>
/// 人脸识别记录业务逻辑类
/// </summary>
[UseDI(ServiceLifetime.Scoped)]
public class FaceScanRecordService
{
    private readonly FaceScanRecordRepository faceScanRecordRepository;

    public FaceScanRecordService(FaceScanRecordRepository faceScanRecordRepository)
    {
        this.faceScanRecordRepository = faceScanRecordRepository;
    }

    public void Create(FaceScanRecord record)
    {
        faceScanRecordRepository.Insert(record);
    }

    public void Update(FaceScanRecord record)
    {
        faceScanRecordRepository.Update(record);
    }

    public FaceScanRecord? GetRecord(int id)
    {
        return faceScanRecordRepository.Get(id);
    }

    public IPagedList<FaceScanRecord> GetRecords(FaceScanRecordQuery query, int pageIndex, int pageSize)
    {
        return faceScanRecordRepository.GetRecords(query, pageIndex, pageSize);
    }
}